import _ from 'lodash'
import Vue from 'vue'
const state = {
     menuparam:{singlemenu:false}
}
const mutations = {
    SET_INFO(state,info){
        let s={};
        if(state[info.root]){
            s=_.assign(s,state[info.root])
        }
        s[info.key]=info.value
        Vue.set(state,info.root,s)
    },
    SET_INFOS(state,info){
        let s={};
        if(state[info.root]){
            s=_.assign(s,state[info.root])
        }
        s=_.assign(s,info.values);
        Vue.set(state,info.root,s)
    }
}
const actions = {
    setValue:function({commit},obj){
        commit('SET_INFO',obj);
    },
    setValues({commit},obj){
        commit("SET_INFOS",obj)
    }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
